/* gvSIG. Geographic Information System of the Valencian Government
 *
 * Copyright (C) 2007-2008 Infrastructures and Transports Department
 * of the Valencian Government (CIT)
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 * MA  02110-1301, USA.
 *
 */
package org.gvsig.raster.osm.swing.impl;

import java.util.Locale;

import org.gvsig.i18n.Messages;
import org.gvsig.raster.osm.swing.OSMSwingLibrary;
import org.gvsig.raster.osm.swing.OSMSwingLocator;
import org.gvsig.tools.library.AbstractLibrary;
import org.gvsig.tools.library.Library;
import org.gvsig.tools.library.LibraryException;

/**
 * Library for default swing implementation initialization and configuration.
 * 
 * @author gvSIG team
 * @version $Id$
 */
public class DefaultOSMSwingLibrary extends AbstractLibrary {

	public DefaultOSMSwingLibrary() {
		super();
	}
	
	@Override
	public void doRegistration() {
	    this.registerAs(OSMSwingLibrary.class, Library.TYPE.IMPL);
	}
	
    @Override
    protected void doInitialize() throws LibraryException {
    	OSMSwingLocator
            .registerSwingManager(DefaultOSMSwingManager.class);
        
        
        if (!Messages.hasLocales()) {
            Messages.addLocale(Locale.getDefault());
        }
        
        Messages.addResourceFamily("org.gvsig.raster.osm.swing.impl.i18n.text",
            DefaultOSMSwingLibrary.class.getClassLoader(),
            DefaultOSMSwingLibrary.class.getClass().getName()); 
        
        registerIcons();
    }

    @Override
    protected void doPostInitialize() throws LibraryException {
    }
    
    private void registerIcons() {
		//IconThemeHelper.registerIcon(null, "icon-jdbc", this);
    }
}
